﻿using LJ.Host.Web.Extensions;
using Microsoft.Extensions.DependencyInjection.Extensions;

namespace LJ.Host.Web;

public class WebHostStartup
{
    public static async Task RunAsync(string[] args)
    {

        var builder = WebApplication.CreateBuilder(args);

        builder.Services.AddLJ(builder.Configuration);

        var app = builder.Build();

        app.UseLJ();


        AppDomain.CurrentDomain.ProcessExit += async (sender, eventArgs) =>
        {
           await app.StopAsync();
        };
        await app.RunAsync();
    }
}
